<?php
function include_email_partial($templateName, $vars = array())
{
  echo get_email_partial($templateName, $vars);
}

function get_email_partial($templateName, $vars = array())
{
  $templateName = explode('/', $templateName);
  $templateName = array_reverse($templateName);
  $templateName[0] = '_'.$templateName[0];
  $templateName = array_reverse($templateName);
  $templateName = implode('/', $templateName);

  $view = new sfPartialView(sfContext::getInstance(), 'Email', $templateName, '');
  $view->setPartialVars($vars);
  return $view->render();
}
